fixed the date and added condition for if current user is not nil