added version check and removed debugs