Fix deploy function