Added logging in an attempt to find out why its not working