fixed some code issues with the php