This is very normal when you are anxious about the act, the place is not right, you are doing under pressure etc. After one or two such failure, one starts developing performance anxiety and that maintains the failure. Do not worry, have a proper place and time for the sex, try to relax yourself during the act, involve more in foreplay and do not rush into the act. Go and get married without any tension, you do not have any major problem.