prevent php errors - fixes #3